var t = getApp();

Page({
    data: {
        navHeight: t.globalData.navHeight,
        options: {},
        detailObj: {}
    },
    getDetail: function() {
        var a = this, o = t.getMobSecret("/api/wechat/get-room-info", {
            uid: t.globalData.userInfo.user_id,
            room_id: this.data.options.roomID
        });
        wx.request({
            url: t.globalData.liveBase + "/api/wechat/get-room-info",
            data: o,
            header: {
                "content-type": "application/json"
            },
            success: function(t) {
                if ("0" == t.data.errorno) {
                    var o = t.data.data;
                    o.start_time = o.start_time.split(" ")[0], a.setData({
                        detailObj: t.data.data
                    });
                }
            },
            fail: function(t) {
                reject(t);
            }
        });
    },
    returnList: function() {
        wx.reLaunch({
            url: "/pages/live-video/video-list/index"
        });
    },
    moreHouse: function() {
        wx.navigateTo({
            url: "/pages/list/list_house"
        });
    },
    onLoad: function(t) {
        wx.setBackgroundColor({
            backgroundColor: "#000000"
        }), this.setData({
            options: t
        });
    },
    onReady: function() {},
    onShow: function() {
        null !== t.globalData.userInfo ? this.getDetail() : (wx.navigateTo({
            url: "/pages/getinfo/index"
        }), t.globalData.needBack = !0);
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {
        return {
            title: this.data.detailObj.building_name + "-看房直播",
            imageUrl: "/images/video/project_temp.jpg",
            path: "/pages/live-video/video-detail/index?roomID=" + this.data.options.roomID
        };
    }
});